<template>
  <el-dialog
    title="毛囊检测人数"
    :visible.sync="dialogVisible"
    width="50%"
    :before-close="handleClose"
  >
    <el-button
      type="primary"
      icon="el-icon-download"
      style="margin-bottom: 10px"
      @click="handleExport"
      >导出EXCEL</el-button
    >
    <el-table v-loading="loading" :data="list">
      <el-table-column label="姓名" align="center" prop="name" />
      <el-table-column label="身份证" align="center" prop="idno" />
      <el-table-column label="联系电话" align="center" prop="mobile" />
      <el-table-column label="人员类型" align="center" prop="type">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.user_type" :value="scope.row.type" />
        </template>
      </el-table-column>
      <!-- <el-table-column
        label="操作"
        align="center"
        class-name="small-padding fixed-width"
      >
        <template slot-scope="scope">
          <el-button
            v-hasPermi="['msg:dcwjTk:edit']"
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            >修改</el-button
          >
          <el-button
            v-hasPermi="['msg:dcwjTk:remove']"
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            >删除</el-button
          >
        </template>
      </el-table-column> -->
    </el-table>
    <pagination
      v-show="false"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </el-dialog>
</template>

<script>
import { getDetail } from "@/api/earlyWarning/mnjz";
export default {
  dicts: ["user_type"],
  data() {
    return {
      dialogVisible: false,
      total: 0,
      list: [],
      loading: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
    };
  },
  methods: {
    openModal() {
      this.dialogVisible = true;
      this.getList();
    },
    getList() {
      this.loading = true;
      getDetail().then((response) => {
        this.loading = false;
        this.list = response.data;
      });
    },
    handleClose(done) {
      done();
    },
    handleExport() {
      this.download(
        "warn/chdj/mftj/export",
        {},
        `毛囊检测_${new Date().getTime()}.xlsx`
      );
    },
  },
};
</script>
